﻿namespace NTLib.Core.Configuration.Attributes
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Expose a type to be referenced during a configuraiton collect.
    /// </summary>
    /// <seealso cref="System.Attribute" />
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
    public sealed class TypeExportConfigurationAttribute : Attribute
    {
        #region Properties

        /// <summary>
        /// Gets or sets the type export. This type will be used to match the type import value of the configuration element with the attribute <see cref="TypeImportConfigurationAttribute"/>
        /// </summary>
        /// <value>
        /// The type of the exposed.
        /// </value>
        public Type ExportType { get; private set; }

        /// <summary>
        /// Gets or sets the key used to specify more detail about the element exposed
        /// </summary>
        /// <value>
        /// The key.
        /// </value>
        public string Key { get; set; }

        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="TypeExportConfigurationAttribute"/> class.
        /// </summary>
        /// <param name="exportType">This type will be used to match the type import value of the configuration element</param>
        public TypeExportConfigurationAttribute(Type exportType)
        {
            this.ExportType = exportType;
            this.Key = "";
        }

        #endregion
    }
}
